<?xml version="1.0" ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lzc="http://schemas.icitadel.com/Lazarus/Compiled.xsd" version="1.0">

	<xsl:output method="text"/>

	<xsl:include href="../../common.xsl" />
	<xsl:include href="../../convert.xsl" />

   <xsl:template match="lzc:project">
-- Project: <xsl:value-of select="@name" /><xsl:text>
-- Script to drop all data from the tables.

SET NOCOUNT ON;
      
SET ANSI_NULLS ON 
GO

-- Delete Data from all Tables.</xsl:text>

      <xsl:for-each select="lzc:tables/lzc:table">
			<xsl:text>
TRUNCATE TABLE [tbl</xsl:text><xsl:value-of select="@name" /><xsl:text>];</xsl:text>
		</xsl:for-each>
	<xsl:text>
GO
	
	</xsl:text>

-- Reseed IDENTITY columns.
<xsl:for-each select="//lzc:table[ lzc:fields/lzc:field[ @type = $DATATYPE_IDENTITY ] ]">
<xsl:text>DBCC CHECKIDENT( 'tbl</xsl:text><xsl:value-of select="@name" /><xsl:text>', RESEED, 1 );
</xsl:text>
</xsl:for-each>

SET ANSI_NULLS OFF
GO   
		
	</xsl:template>
</xsl:stylesheet>